package com.xai.pg.util;

public class OSInfo {

    private static final String OS = System.getProperty("os.name").toLowerCase();

    public static boolean isLinux() {
        return OS.indexOf("linux") >= 0;
    }

    public static boolean isMacOS() {
        return OS.indexOf("mac") >= 0;
    }

    public static boolean isWindows() {
        return OS.indexOf("windows") >= 0;
    }

    public static String buildPath(String... strs) {
        StringBuilder sb = new StringBuilder("/");
        for (String str : strs) {
            sb.append(str).append("/");
        }
        sb = sb.deleteCharAt(sb.lastIndexOf("/"));
        return sb.toString();
    }
}
